home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / comm / misc / thor10.lha / Thor / InstallThor < prev    next >
Text File  |  1993-11-01  |  13KB  |  569 lines

  1. ;*************************************************************************
  2. ;    Title:
  3. ;        Install-Thor
  4. ;*************************************************************************
  5. ;    Description:
  6. ;        Commodore Installer Script for the Thor software
  7. ;*************************************************************************
  8. ;    Author:
  9. ;        Øyvind Ellefsen
  10. ;*************************************************************************
  11. ;    Still to do:
  12. ;
  13. ;*************************************************************************
  14. ;    History:
  15. ;        4/8-93   - First tries. Ver 00
  16. ;        4/8-93   - Working version. Copying files&stuff.
  17. ;        5/8-93   - Asking for install from disk Ver. 02
  18. ;        7/8-93   - What's up? New beta.. Shit! Ver. 03
  19. ;        5/9-93   - Ok. Final effort.. Ver. 06
  20. ;        21/9-93  - Changes Changes... ARRGGHH!! Ver. 07
  21. ;        23/9-93  - Removed beta-strings. Polished help-texts. Release Ver.
  22. ;        7/10-93  - Added Reqtools.library install.
  23. ;        10/10-93 - Convert, ChoiceType, User-startup, CheckForThor
  24. ;        12/10-93 - Assign-handling
  25. ;       13/10-93 - Custom ReqTools.library install
  26. ;         14/10-93 - Device/Volume check
  27. ;        1/11-93  - Added some CfgArchivers shit
  28. ;*************************************************************************
  29. ;
  30. ;******************************************************
  31. ;***** SET UP OUR VARIABLES AND OTHER SUCH STUFF ******
  32. ;******************************************************
  33.  
  34. ; some useful variables
  35.     (set true 1)
  36.     (set false 0)
  37.     (set yes true)
  38.     (set no false)
  39.     (set is_a_file 1)
  40.     (set is_a_dir 2)
  41.     (set quote "\"")
  42.     (set newline "\n")
  43.     (set nothing "")
  44.     (set Convert No)
  45.  
  46. ; set up our delete options
  47.     (delopts "AskUser" "OkNoDelete" "Force")
  48.  
  49. ; some useful procedures
  50.     ; change userlevel to expert
  51.     (procedure expert_level
  52.         (
  53.             (user 2)
  54.         )
  55.     )
  56.  
  57. ; reset userlevel back to default
  58.     (procedure default_level
  59.         (
  60.             (user default-level)
  61.         )
  62.     )
  63.  
  64. ; store off userlevel
  65.     (procedure save_default_level
  66.         (
  67.             (set default-level @user-level)
  68.         )
  69.     )
  70.  
  71. ; some overused strings
  72. (set omp (cat "One moment please..." newline))
  73.  
  74.  
  75. ; introduce ourselfs to the viewers
  76. (welcome "Welcome to the Thor installer.  This installer uses "
  77.     "the Commodore Amiga Installer.  All of our future Thor releases "
  78.     "will be using this installer and we would like to get any feedback "
  79.     "that might help in improving the installation procedure." newline
  80. )
  81.  
  82.  
  83. ; first reset the user level so that the novice can see whats going on
  84.     (save_default_level)
  85.     (expert_level)
  86.  
  87. ;Make assign to install from
  88.     (makeassign "Thor_Install" "" (safe))
  89.  
  90. ; Get Assigns and partitions
  91.     (set BBSdata_Dir (getassign "BBSData"))
  92.     (set BBSData_Device (getassign "BBSData" "d"))
  93.     (set BBSData_Volume (getassign "BBSData" "v"))
  94.     (set Thor_Dir (getassign "Thor"))
  95.     (set Thor_Device (getassign "Thor" "d"))
  96.     (set Thor_Volume (getassign "Thor" "v"))
  97.     (set BBSDataUpdate No)
  98.     (set BBSDataIsVolume No)
  99.     (set BBSDataIsDevice No)
  100.     (set BBSDataHard No)
  101.     (set ThorUpdate No)    
  102.     (set ThorIsDevice No)
  103.     (set ThorIsVolume No)
  104.     (set ThorHard No)
  105.         
  106. (if (<> Thor_Dir nothing)
  107.     (set ThorUpdate Yes)
  108.     (set Thor_Dir "Work")
  109. )
  110. (if (<> Thor_Device nothing)
  111.     (
  112.         (set ThorUpdate Yes)
  113.         (set ThorIsDevice Yes)
  114.         (set Thor_Dir Thor_Device)
  115.         (set ThorHard Yes)
  116.     )
  117. )
  118. (if (<> Thor_Volume nothing)
  119.     (
  120.         (set ThorUpdate Yes)
  121.         (set ThorIsVolume Yes)
  122.         (set Thor_Dir Thor_Volume)
  123.         (set ThorHard Yes)
  124.     )
  125. )
  126.  
  127. (if (<> BBSData_Dir nothing)
  128.     (set BBSDataUpdate Yes)
  129. )
  130. (if (<> BBSData_Device nothing)
  131.     (
  132.         (set BBSDataUpdate Yes)
  133.         (set BBSDataIsDevice Yes)
  134.         (set BBSData_Dir BBSData_Device)
  135.         (set BBSDataHard Yes)
  136.     )
  137. )
  138. (if (<> BBSData_Volume nothing)
  139.     (
  140.         (set BBSDataUpdate Yes)
  141.         (set BBSDataIsVolume Yes)
  142.         (set BBSData_Dir BBSData_Volume)
  143.         (set BBSDataHard Yes)
  144.     )
  145. )
  146.  
  147. ;******************
  148. ;** Check Memory **
  149. ;******************
  150.  
  151. (set Running (run "Thor_Install:CheckForThor"))
  152. (debug "Running= "running)
  153.  
  154. (while (= Running 20)
  155.       ((Message newline "Thor seem to be running, you MUST close it NOW."    
  156.         newline "If you don't, the installation will fail!")
  157.     (set Running (run "Thor_Install:thor/bin/CheckForThor")))
  158. )
  159.  
  160.  
  161. ;************************
  162. ;** Start Installation **
  163. ;************************
  164.  
  165. (run "Avail flush")
  166.         
  167. (if (= ThorUpdate Yes)
  168. ;then    
  169.     (if (askbool
  170.             (prompt "Thor seems to be installed on your system already." newline
  171.                 "The program resides in " quote Thor_Dir quote "." newline
  172.                 "Do you want to install Thor over it?")
  173.             (help
  174.                 "The installer has determined that you may already have a "
  175.                 "copy of Thor installed on your system. If this is wrong or "
  176.                 "you want the update installed elsewhere, select NO as an "
  177.                 "answer. Otherwise, select YES."
  178.             )
  179.             (default 1)
  180.         )
  181.     ; Then
  182.         ( 
  183.             (set is_update Yes) 
  184.         )
  185.     ; Else
  186.         ( 
  187.             (set is_update No) 
  188.             (set Thor_Dir 
  189.                 (askdir
  190.                     (prompt "Where would you like Thor installed?"
  191.                     newline "The installer will NOT create a directory")
  192.                     (help @askdir-help)
  193.                     (default "Work:")
  194.                     (newpath)
  195.                 )
  196.             )
  197.             (set user_script (cat user_script (cat "Assign Thor: " quote Thor_dir quote newline)))
  198.         )
  199.     )
  200. ;Else
  201.     ((set Thor_Dir
  202.         (askdir
  203.             (prompt "Where would you like Thor installed?"
  204.             newline "The installer will NOT create a directory")
  205.             (help @askdir-help)
  206.             (default @default-dest)
  207.             (newpath)
  208.         )
  209.     )
  210.     (set user_script (cat "Assign Thor: " quote Thor_dir quote newline))
  211.     )
  212. )
  213.  
  214. ; before we go on lets reset the user's level back to what it was
  215. (default_level)
  216.  
  217. ; verify that the Thor directory exists
  218. (if (<> (exists Thor_Dir) is_a_dir)
  219.     (
  220.         (makedir Thor_Dir
  221.             (prompt
  222.                 "The directory you have selected for Thor does not "
  223.                 "seem to exist.  Do you want us to create it for you?"
  224.             )
  225.             (help @makedir-help)
  226.             (infos)
  227.             (confirm)
  228.         )
  229.         (set user_script (cat "Assign Thor: " quote Thor_dir quote newline))
  230.     )
  231. )
  232.  
  233. (makeassign "Thor" Thor_dir)
  234.  
  235. (makedir "Thor:Data")
  236.  
  237. ;*************
  238. ;** BBSData **
  239. ;*************
  240.  
  241. (debug "BBSDataDir=" BBSDataDir)
  242.  
  243. (default_level)
  244. ;(if(= @user-level 2)
  245. ; Then
  246.     (if (= BBSDataUpdate Yes)
  247.     ; Then
  248.         (if (askbool
  249.             (prompt "There seems to be a message database installed on your system already."
  250.                 "The database resides in " quote BBSData_Dir quote "." newline
  251.                 "Do you want to use this database further?"
  252.             )
  253.             (help
  254.                 "The installer has determined that you may already have a "
  255.                 "message database installed on your system. If this is wrong or "
  256.                 "you want the database installed elsewhere, select NO as an "
  257.                 "answer. Otherwise, select YES."
  258.             )
  259.             (default 1)
  260.     
  261.             )    
  262.         ; Then
  263.             (
  264.                 (set RunCfgArchivers No)
  265.             )
  266.         ; Else 
  267.             (
  268.                 (set RunCfgArchivers Yes)
  269.                 (set BBSDataMove Yes)
  270.                 (set is_update No)
  271.                 (set BBSData_Dir 
  272.                     (askdir
  273.                     (prompt "Where would you like the message database installed?"
  274.                         newline "The installer will NOT create a directory")
  275.                     (help @askdir-help)
  276.                     (default "Thor:Data")
  277.                     (newpath)
  278.                     )
  279.                 )
  280.                 (set user_script (cat user_script (cat "Assign BBSData: " quote BBSData_dir quote newline)))
  281.             )
  282.         )
  283.     ; Else
  284.         (
  285.             (set RunCfgArchivers Yes)
  286.             (set BBSData_Dir (cat Thor_Dir "/Data"))
  287.             (set user_script (cat user_script (cat "Assign BBSData: " quote BBSData_dir quote newline)))
  288.         )
  289.     )    
  290.  
  291. ; Else
  292. ;
  293. ;    (
  294. ;        (set BBSData_Dir (cat Thor_Dir "/Data"))
  295. ;        (set user_script (cat user_script (cat "Assign BBSData: " quote BBSData_dir quote newline)))
  296. ;        (debug "BBSData_Dir if Intermediate=" BBSData_Dir)
  297. ;    )
  298. ;)
  299.  
  300. ;***********************************
  301. ;***** GET FIRST DISK IN HERE ******
  302. ;***********************************
  303.  
  304. ; first copy over the stuff
  305. (working omp "Scanning Thor Program disk for files.")
  306.  
  307. (copyfiles
  308.      (prompt "Copying files needed by Thor")
  309.     (help "This will copy the program and support files needed by Thor."
  310.     newline
  311.     @copyfiles-help
  312.     )
  313.     (source "Thor_Install:thor")
  314.     (dest Thor_dir)
  315.     (optional nofail force askuser)
  316.     (all)
  317.     (infos)
  318. )
  319.     
  320.  
  321. ;******************
  322. ;** User-Startup **
  323. ;******************
  324.  
  325. (debug "Startup = " user_script)
  326. (save_default_level)
  327. (expert_level)
  328. (if (= is_update Yes)
  329. ;Then 
  330.     (set is_update Yes)
  331. ;else
  332.     (if (= BBSDataMove Yes)
  333.     ;Then
  334.         (
  335.         ; now figure out the addition to the user-startup
  336.         (Debug "User_Script=" user_script)
  337.  
  338.         ; modify S:User-Startup
  339.         (working omp "Updating S:User-Startup.")
  340.             (startup "Thor"
  341.             (prompt
  342.                 "These instructions need to be added to the \"S:User-Startup\" "
  343.                 "so that your system will be properly configured to use Thor "
  344.                 newline
  345.                 newline
  346.                 user_script
  347.             )
  348.                     (help @startup-help)
  349.                     (command user_script)
  350.             )
  351.         )
  352.     ;Else
  353.         (
  354.         ; now figure out the addition to the user-startup
  355.         ; modify S:User-Startup
  356. (Debug "User_Script=" user_script)
  357.         (working omp "Updating S:User-Startup.")
  358.             (startup "Thor"
  359.             (prompt
  360.                 "These instructions need to be added to the \"S:User-Startup\" "
  361.                 "so that your system will be properly configured to use Thor "
  362.                 newline
  363.                 newline
  364.                 user_script)
  365.             (help @startup-help)
  366.             (command user_script)
  367.             
  368.             )
  369.         )
  370.     )
  371. )
  372.  
  373. ;*********************
  374. ;** reqtools.libary **
  375. ;*********************
  376.  
  377. (default_level)
  378. (debug "ReqTools" @user-level)
  379. (if(= @user-level 2)
  380. ;then 
  381.     (copylib
  382.         (prompt "Copying ReqTools library")
  383.         (help "This will copy the ReqTools library." newline @copylib-help)
  384.         (source "Thor_Install:ReqTools.library")
  385.         (dest "libs:")
  386.         (confirm)
  387.     )
  388.  
  389. ;else
  390.     (copylib
  391.         (prompt "Copying ReqTools library")
  392.         (help "This will copy the ReqTools library." newline @copylib-help)
  393.         (source "Thor_Install:ReqTools.library")
  394.         (dest "libs:")
  395.     )
  396. )
  397.  
  398. ;************
  399. ;** CfgBBS **
  400. ;************
  401.  
  402. (default_level)
  403.  
  404. (debug "CfgBBS" @user-level)
  405.  
  406. (set name
  407.    (askoptions
  408.       (prompt "Choose the BBS Types to install:")
  409.       (help "Choose the BBS Types you are going to use with Thor" newline newline @askchoice-help)
  410.       (choices "QWK         - General QWK" "ABBS        - Plain ABBS" "MBBS        - Plain MBBS" "ABBS_QWK    - ABBS with QWK support" "MBBS_QWK    - MBBS with QWK support" "MBBS_SP_QWK - Crusaders-type MBBS_QWK")
  411.       (default 63)
  412.    )
  413. )
  414.  
  415. (debug BBSData_dir)
  416.  
  417. (makeassign "BBSData" BBSData_dir)
  418.  
  419. (if (= RunCfgArchivers Yes)
  420.     (    
  421.         (execute "thor:s/CfgArchivers")
  422.         (debug "Runnin' CfgShitArchivers")
  423.     )
  424. )
  425.  
  426. (Debug "Name="name)
  427. (if (bitand 1 name)
  428.    (execute "thor:s/CfgQwk")
  429. (Debug "1")
  430. )
  431. (if (bitand 2 name)
  432.    (execute "thor:s/CfgAbbs")
  433. (Debug "2")
  434. )
  435. (if (bitand 4 name)
  436.    (execute "thor:s/CfgMbbs")
  437. (Debug "4")
  438. )
  439. (if (bitand 8 name)
  440.    (execute "thor:s/CfgAbbs_qwk")
  441. (Debug "8")
  442. )
  443. (if (bitand 16 name)
  444.    (execute "thor:s/CfgMbbs_qwk")
  445. (Debug "16")
  446. )
  447. (if (bitand 32 name)
  448.    (execute "thor:s/CfgMbbs_sp_qwk")
  449. (Debug "32")
  450. )
  451.  
  452.  
  453. ;*************
  454. ;** Convert **
  455. ;*************
  456. (debug "Convert="Convert)
  457.  
  458. (run "Avail flush")
  459.  
  460. (if (= Convert Yes)
  461. ;Then
  462.     (
  463.         (default_level)
  464.         (debug "Convert" @user-level)
  465.         (if(= @user-level 2)
  466.         ;then 
  467.             (
  468.                 (message newline "The installer will now convert and upgrade the "
  469.                     newline "message database and configuration for you.")
  470.                 (run "Thor_install:thor/bin/convert convert")
  471.                 (Debug "Running Convert")
  472.             )
  473.     
  474.         ;else
  475.             (
  476.                 (working omp)
  477.                 (run "Thor:Install:thor/bin/convert convert")    
  478.                 (Debug "Running Convert")
  479.             )    
  480.         )
  481.     )
  482. ;Else
  483. (Set Convert No)
  484. )
  485.  
  486. ;***********
  487. ;** Fonts **
  488. ;***********
  489.     
  490. (copyfiles
  491.     (prompt "Choose the fonts to install with Thor" newline "These are not required for Thor to run" )
  492.     (help "This will copy the default font files for Thor." newline @copyfiles-help)
  493.     (source "Thor_Install:Fonts")
  494.     (dest "Fonts:")
  495.     (fonts)
  496.     (choices "Grn" "Thin609" "Thin611" "Thin711")
  497.     (confirm)
  498. )
  499.  
  500.  
  501.  
  502. ;***************
  503. ;** LogReader **
  504. ;***************
  505.  
  506. (if    (askbool
  507.         (prompt newline "Do you want the LogReader software installed?")
  508.         (help newline "The LogReader software is a program for" newline
  509.              "calculating phone-bills from logfiles." newline
  510.             newline "Select YES if you want it installed, otherwise NO")
  511.         (default 1)
  512.     )
  513.     
  514. ; Then
  515.     (copyfiles
  516.         (prompt "Copying LogReader files")
  517.         (help "This will copy the files needed by LogReader." newline @copyfiles-help)
  518.         (source "Thor_Install:LogReader")
  519.         (dest Thor_dir)
  520.         (all)
  521.         (infos)
  522.     )
  523. )
  524.  
  525. ;****************
  526. ;** AmigaGuide **
  527. ;****************
  528.  
  529. (if    (askbool
  530.         (prompt newline "Do you want the AmigaGuide" newline "program and library installed?"
  531.             newline newline "If you have a newer version of the library" newline 
  532.             "on your system, it will NOT be overwritten")
  533.         (help newline "The AmigaGuide library is needed for the Thor documentation."
  534.             newline newline "Select YES if you want it installed, otherwise NO")
  535.         (default 1)
  536.     )
  537. ; Then
  538.     (
  539.         (copyfiles
  540.             (prompt "Copying AmigaGuide program file")
  541.             (help "This will copy the files needed by AmigaGuide." newline @copyfiles-help)
  542.             (source "Thor_Install:AmigaGuide")
  543.             (dest "sys:Utilities")
  544.         )
  545.         (copylib
  546.             (prompt "Copying AmigaGuide library")
  547.             (help "This will copy the AmigaGuide library." newline @copylib-help)
  548.             (source "Thor_Install:AmigaGuide.library")
  549.             (dest "libs:")
  550.         )
  551.     )
  552. )
  553.  
  554. ;*****************************
  555. ;***** WE ARE ALMOST DONE ****
  556. ;*****************************
  557.  
  558. ; make sure that default-dir is pointing to the right place
  559. (set @default-dest Thor_Dir)
  560.     
  561. (makeassign "Thor_Install")     
  562. (makeassign "Thor_Disk" (safe))
  563.  
  564. ; final message for our viewers
  565.     (set end_text (cat("Reboot your system now!" newline)))
  566.  
  567. ; now for the exit
  568.     (exit end_text)
  569.